﻿public class WallBlockWayFactory
{
    public WallBlockWay create()
    {
        WallModel wallModel = createWallModel();
        WaveFactory waveFactory = createWaveFactoryWith(wallModel);
        WallWaveManager wallWaveManager = createWaveManagerWith(waveFactory);

        WallBlockWay result = createWallBlockWay(wallModel.CountBlocks, wallWaveManager);

        return result;
    }

    private WallModel createWallModel()
    {
        DAL dal = DAL.Instance;
        return dal.createWallModel();
    }

    private WaveFactory createWaveFactoryWith(WallModel wallModel)
    {
        return new WaveFactory(wallModel);
    }

    private WallWaveManager createWaveManagerWith(WaveFactory waveFactory)
    {
        WallWaveManager wallWaveManager = new WallWaveManager(waveFactory);

        return wallWaveManager;
    }

    private WallBlockWay createWallBlockWay(int countBlocks, WallWaveManager wallWaveManager)
    {
        return new WallBlockWay(countBlocks, wallWaveManager);
    }
}
